package com.srd.phone.bean;


import org.json.JSONException;
import org.json.JSONObject;

public class AuditLoanDetail {

    public String nm;  /* 标名 */
    public String tidm; /* 借款标类型 */
    public double moneys;  /* 借款金额 */
    public double anyield;  /* 利率 */
    public double interest;   /* 利息 */
    public int cdata;  // 需要提交的资料
    public int csttr;   // 审核通过的资料
    public int cstfl;   // 审核未通过的资料
    public int subsch;  // 投标进度

    public static AuditLoanDetail parseData(String json){
        AuditLoanDetail detail = new AuditLoanDetail();
        try {
            JSONObject jsonObj = new JSONObject(json);
            detail.nm = jsonObj.optString("nm");
            detail.tidm = jsonObj.optString("tidm");
            detail.moneys = jsonObj.optDouble("moneys",0);
            detail.anyield = jsonObj.optDouble("anyield",0);
            detail.interest = jsonObj.optDouble("interest",0);
            detail.cdata = jsonObj.optInt("cdata");
            detail.csttr = jsonObj.optInt("csttr");
            detail.cstfl = jsonObj.optInt("cstfl");
            detail.subsch = jsonObj.optInt("subsch");
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return detail;
    }
}
